/**
 * Created by ptt on 2016/5/27/0027.
 */
define(["./../navigation/dataHandle.js", "./tpl.js", "../maintools/Controller.js"], function (handle, tpl, Controller) {
    //initial searchbox has bug for global value jQuery
    Controller = Controller.Controller;
    tpl = tpl.hint;
    $("#hint").html(tpl.render({info: "数据正在加载"}));

    var triggerHint = Controller.create({
        init: function (element) {
            this.el = jQuery(element);
            this.refreshElements();
            this.delegateEvents();
            Message_bone.on("infoStart", this.proxy(this.show));
            Message_bone.on("infoEnd", this.proxy(this.hide));
        },
        show: function (e) {
            var elem = this.el;
            elem.removeClass("hide");
        },
        hide: function (e) {
            var elem = this.el;
            elem.addClass("hide");
        }
    });
    var trigger = new triggerHint("#hint");
    //trigger.show();
    return {
        hintController: trigger
    };
});